// This file is part of OpenTSDB.
// Copyright (C) 2017 TeleDB Development Group.
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 2.1 of the License, or (at your
// option) any later version.  This program is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
// General Public License for more details.  You should have received a copy
// of the GNU Lesser General Public License along with this program.  If not,
// see <http://www.gnu.org/licenses/>.
package net.opentsdb.utils.enums;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
 * hbase 表的family和qulitifer
 */
public interface FamQuls {
    // tsdb-meta表
    interface META extends FamQuls{
        enum FAMILY implements META{
            NAME("name"),
            DEL("del"),
            COUNT("count");

            private String name;
            public String getName() {
                return name;
            }
            public byte[] getByte(){ return name.getBytes(CHARSET); }
            FAMILY(String name){
                this.name = name;
            }
        }
        enum QULITIFER implements META{
            META("ts_meta"),
            COUNTER("ts_ctr");

            private String name;
            public String getName(){ return name; }
            public byte[] getByte(){ return name.getBytes(CHARSET); }
            QULITIFER(String name){ this.name = name; }
        }
    }
    // tsdb-tag表
    interface TAG extends FamQuls{
        enum FAMILY implements TAG{

            Mtric("m"),
            Tagk("k"),
            Tagv("v");

            private String name;
            public String getName() {
                return name;
            }
            public byte[] getByte(){ return name.getBytes(CHARSET); }
            FAMILY(String name){
                this.name = name;
            }
        }
    }
    // tsdb-uid表
    interface UID extends FamQuls{}
    // tsdb-tree表
    interface TREE extends FamQuls{}
    // 数据源表
    interface DATA extends FamQuls{}

    Charset CHARSET = StandardCharsets.UTF_8;

    default String getName(){ return ""; }
    default byte[] getByte(){ return "".getBytes(CHARSET); }

}
